Interrupt control apparatus, interrupt control method, and computer readable medium

ABSTRACT

An interrupt handler unit ( 130 ) generates a timer interrupt at an interrupt time, and executes an interrupt preparation process. A wait time period measurement unit ( 142 ) a measures a time period from completion of the interrupt preparation process to generation of a start request ( 201 ) as a wait time period. A time calculation unit ( 441 ) calculates a subtraction time period based on the wait time period measured by the wait time period measurement unit ( 142 ), and calculates a preparation time period that is the sum of a time period obtained by subtracting the subtraction time period from the wait time period and a processing time period of the interrupt preparation process. The time calculation unit ( 441 ) stores a time obtained by shifting back the preparation time period from the time of a next start request ( 201 ), as a next interrupt time, in a time storage unit ( 442 ).

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a Continuation of PCT International Application No.PCT/JP2018/028502, filed on Jul. 30, 2018, all of which is herebyexpressly incorporated by reference into the present application.

TECHNICAL FIELD

The present invention relates to an interrupt control apparatus, aninterrupt control method, and an interrupt control program.

BACKGROUND ART

Device control is realized by periodically performing a series of stepsof a control process such as input of information from a control targetdevice, computation, and output of information to the control targetdevice. Therefore, it is necessary to periodically generate a signal tobe a start request and start the control process at the timing of thestart request. Furthermore, the control process needs to be started withlow latency from the timing of the start request.

By implementing the control process with an interrupt process andgenerating an interrupt at the timing of the start request, the controlprocess can be started with priority over an application that is beingexecuted. However, a preparation process such as saving context, whichis performed at the entrance of an interrupt handler, causes start ofthe control process to be delayed from the timing of the start request.This preparation process is also referred to as an interrupt handlerentrance process or an interrupt preparation process.

As described above, if the interrupt preparation process is started atthe timing of the start request, the start of the control process may bedelayed. Therefore, a method has been proposed in the past in which atime period required for the interrupt preparation process is measured,and the interrupt preparation process is started at a time that isearlier than the start request by that time period.

Patent Literature 1 discloses a technique in which in order to start atarget process from a start time with low latency, a timer interrupt isgenerated at a time that is earlier than the start time by an interruptreservation time period.

CITATION LIST Patent Literature

Patent Literature 1: JP 2013-097659 A

SUMMARY OF INVENTION Technical Problem

In Patent Literature 1, in order to complete the preparation processbefore generation of a start request, a processing time period of thepreparation process needs to be measured in advance. In addition, inPatent Literature 1, a certain margin is set in the processing timeperiod of the preparation process with a fixed value, so that a waittime period occurs. Furthermore, in Patent Literature 1, there is noarrangement to adjust the wait time period.

It is an object of the present invention to adjust an interrupt time atwhich a preparation process is to be started such that the preparationprocess is completed immediately before a start request with a minimummargin, without measuring a processing time period of the preparationprocess in advance.

Solution to Problem

An interrupt control apparatus according to the present invention startsan interrupt process in response to a start request generated regularly,and the interrupt control apparatus includes:

a time storage unit to store an interrupt time at which an interruptpreparation process for preparing for the interrupt process is to bestarted;

an interrupt handler unit to generate a timer interrupt at the interrupttime, and execute the interrupt preparation process;

a wait time period measurement unit to measure a wait time period fromcompletion of the interrupt preparation process to generation of thestart request; and

a time calculation unit to calculate a subtraction time period based onthe wait time period, calculate a preparation time period that is a sumof a time period obtained by subtracting the subtraction time periodfrom the wait time period and a processing time period of the interruptpreparation process, and store a time obtained by shifting back thepreparation time period from a time of a next start request, as a nextinterrupt time, in the time storage unit.

Advantageous Effects of Invention

In an interrupt control apparatus according to the present invention, atime calculation unit calculates a preparation time period that is thesum of a time period obtained by subtracting a subtraction time periodfrom a wait time period and a processing time period of an interruptpreparation process, and sets a time obtained by shifting back thepreparation time period from the time of a next start request, as a nextinterrupt time. In the interrupt control apparatus according to thepresent invention, the preparation time period is shortened depending onthe wait time period, so that an interval between the interrupt time andthe time of a start request can be shortened. Therefore, in theinterrupt control apparatus according to the present invention, theinterrupt time can be set such that the interrupt preparation process iscompleted immediately before the start request with a minimum margin.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a hardware configuration diagram of an interrupt controlsystem and an interrupt control apparatus according to a firstembodiment;

FIG. 2 is a functional configuration diagram of the interrupt controlapparatus according to the first embodiment;

FIG. 3 is a flowchart illustrating operation of the interrupt controlapparatus according to the first embodiment;

FIG. 4 is a timing diagram based on an interrupt management processaccording to the first embodiment;

FIG. 5 is a detailed flowchart of the interrupt management processaccording to the first embodiment;

FIG. 6 is a detailed flowchart of a timing prediction process accordingto the first embodiment;

FIG. 7 is a detailed flowchart of a control process according to thefirst embodiment;

FIG. 8 is an example of a timing diagram to be compared with theinterrupt management process according to the first embodiment;

FIG. 9 is another example of a timing diagram to be compared with theinterrupt management process according to the first embodiment;

FIG. 10 is a functional configuration diagram of an interrupt controlapparatus according to a second embodiment;

FIG. 11 is a detailed flowchart of an interrupt management processaccording to the second embodiment;

FIG. 12 is a hardware configuration diagram of an interrupt controlsystem and an interrupt control apparatus according to a thirdembodiment;

FIG. 13 is a functional configuration diagram of the interrupt controlapparatus according to the third embodiment;

FIG. 14 is a flowchart illustrating operation of a core-0 of theinterrupt control apparatus according to the third embodiment;

FIG. 15 is a detailed flowchart of a periodic interrupt managementprocess according to the third embodiment; and

FIG. 16 is a flowchart illustrating operation of a core-1 of theinterrupt control apparatus according to the third embodiment.

DESCRIPTION OF EMBODIMENTS

Embodiments of the present invention will be described hereinafter withreference to the drawings. Throughout the drawings, the same orcorresponding portions are denoted by the same reference signs. In thedescription of the embodiments, description of the same or correspondingportions will be omitted or simplified as appropriate.

First Embodiment

In this embodiment, an interrupt control apparatus 100 to start aninterrupt process based on a start request generated regularly will bedescribed. The interrupt control apparatus 100 starts a control processas the interrupt process in response to a start request that is inputperiodically from the outside. In particular, an aspect to be describedin this embodiment is that an interrupt time of a timer interrupt to begenerated before a next start request is predicted based on ameasurement value of a wait time period when the current timer interruptis generated. The interrupt time is also referred to as an interrupttiming.

*** Description of Configurations ***

FIG. 1 is a hardware configuration diagram of an interrupt controlsystem 500 and the interrupt control apparatus 100 according to thisembodiment. FIG. 2 is a functional configuration diagram of theinterrupt control apparatus 100 according to this embodiment.

Referring to FIGS. 1 and 2, configurations of the interrupt controlsystem 500 and the interrupt control apparatus 100 according to thisembodiment will be described.

The interrupt control system 500 includes the interrupt controlapparatus 100, a periodic signal device 200, and a control target device300. The interrupt control apparatus 100 obtains a periodic signal fromthe periodic signal device 200 as a start request 201, and uses thestart request 201 as a trigger to perform the control process to controlthe control target device 300. The periodic signal device 200periodically inputs the start request 201 to the interrupt controlapparatus 100. The control target device 300 operates based on input andoutput of control information exchanged with the interrupt controlapparatus 100.

The interrupt control apparatus 100 is a computer. The interrupt controlapparatus 100 includes a processor 1 and also includes other hardwarecomponents such as a memory 2, a periodic signal interface 3, and acontrol target interface 4. The processor 1 is a single-core processorand is a device to perform the control process. The memory 2 is a deviceto store data necessary for the control process. The periodic signalinterface 3 is a device to obtain a start request from the periodicsignal device 200 located externally. The control target interface 4 isa device to perform input and output of control information exchangedwith the control target device 300 located externally.

The hardware configuration of the interrupt control apparatus 100 willbe described in detail below.

In addition to the above hardware components, the interrupt controlapparatus 100 may include other hardware components such as an auxiliarystorage device, an input interface, an output interface, and acommunication device. The processor 1 is connected with other hardwarecomponents via signal lines and controls the other hardware components.

The interrupt control apparatus 100 includes, as functional elements, anOS execution unit 110, an application processing unit 120, an interrupthandler unit 130, and an interrupt processing unit 140. Functionalelements of the interrupt processing unit 140 will be described indetail later.

The functions of the interrupt handler unit 130 and the interruptprocessing unit 140 are realized mainly by software. Among the elementsof the interrupt processing unit 140, a time storage unit 442 to bedescribed later is provided in the memory 2. A control information inputunit 451 and a result output unit 453 may be provided in the controltarget interface 4.

The processor 1 is a device to execute an interrupt control program. Theinterrupt control program is a program to realize the functions of theinterrupt handler unit 130 and the interrupt processing unit 140.

The processor 1 is an integrated circuit (IC) that performs arithmeticprocessing. Specific examples of the processor 1 are a CPU, a digitalsignal processor (DSP), and a graphics processing unit (GPU).

The memory 2 is a storage device to temporarily store data. Specificexamples of the memory 2 are a static random access memory (SRAM) and adynamic random access memory (DRAM).

The auxiliary storage device is a storage device to store data. Aspecific example of the auxiliary storage device is an HDD.Alternatively, the auxiliary storage device may be a portable storagemedium such as an SD (registered trademark) memory card, CF, a NANDflash, a flexible disk, an optical disc, a compact disc, a Blu-ray(registered trademark) disc, or a DVD. HDD is an abbreviation for HardDisk Drive. SD (registered trademark) is an abbreviation for SecureDigital. CF is an abbreviation for CompactFlash (registered trademark).DVD is an abbreviation for Digital Versatile Disk.

The input interface is a port to be connected with an input device suchas a mouse, a keyboard, or a touch panel. Specifically, the inputinterface is a Universal Serial Bus (USB) terminal. The input interfacemay be a port to be connected with a local area network (LAN).

The output interface is a port to which a cable of an output device suchas a display is to be connected. Specifically, the output interface is aUSB terminal or a High Definition Multimedia Interface (HDMI, registeredtrademark) terminal. Specifically, the display is a liquid crystaldisplay (LCD).

The communication device has a receiver and a transmitter. Thecommunication device is connected to a communication network such as aLAN, the Internet, or a telephone line. Specifically, the communicationdevice is a communication chip or a network interface card (NIC).

The interrupt control program is read by the processor 1 and executed bythe processor 1. The memory stores not only the interrupt controlprogram but also an operating system (OS). The processor 1 executes theinterrupt control program while executing the OS. The interrupt controlprogram and the OS may be stored in the auxiliary storage device. Theinterrupt control program and the OS stored in the auxiliary storagedevice are loaded into the memory 2 and executed by the processor 1.Part or the entirety of the interrupt control program may be embedded inthe OS.

The interrupt control apparatus 100 may include a plurality ofprocessors as an alternative to the processor 1. The plurality ofprocessors share the execution of the interrupt control program. Each ofthe processors is, like the processor 1, a device to execute theinterrupt control program.

Data, information, signal values, and variable values that are used,processed, or output by the interrupt control program are stored in thememory 2 or the auxiliary storage device, or stored in a register or acache memory in the processor 1.

“Unit” of each unit of the interrupt control apparatus 100 may beinterpreted as “process”, “procedure”, or “step”. Each unit of theinterrupt control apparatus 100 refers to the interrupt handler unit 130and, in addition, an interrupt management unit 141, a wait time periodmeasurement unit 142, a start request wait unit 143, a time calculationunit 441 of a timing prediction unit 144, and a control processcomputation unit 452 of a control processing unit 145, which are to bedescribed later. That is, each unit of the interrupt control apparatus100 refers to the interrupt handler unit 130, the interrupt managementunit 141, the wait time period measurement unit 142, the start requestwait unit 143, the time calculation unit 441, and the control processcomputation unit 452.

“Process” in each of the interrupt handler process, the interruptmanagement process, the wait time period measurement process, the startrequest wait process, the timing prediction process, the controlprocess, the time calculation process, and the control processcomputation process may be interpreted as “program”, “program product”,or “computer readable storage medium recording a program”.

The interrupt control program causes a computer to execute each process,each procedure, or each step, where “unit” of each of the above units isinterpreted as “process”, “procedure”, or “step”. An interrupt controlmethod is a method implemented by execution of the interrupt controlprogram by the interrupt control apparatus 100.

The interrupt control program may be stored and provided in a computerreadable recording medium. Alternatively, the interrupt control programmay be provided as a program product.

*** Overview Description of Functions ***

The interrupt control apparatus 100 includes the OS execution unit 110,the application processing unit 120, the interrupt handler unit 130, andthe interrupt processing unit 140.

The interrupt handler unit 130 generates a timer interrupt at aninterrupt time, and executes an interrupt preparation process.Specifically, the interrupt handler unit 130 generates the timerinterrupt at the interrupt time stored in the time storage unit 442. Theinterrupt handler unit 130 generates the timer interrupt to interruptexecution of an application performed by the application processing unit120, executes the interrupt preparation process, and causes thefunctions of the interrupt management unit 141 of the interruptprocessing unit 140 to be executed.

The interrupt processing unit 140 includes the interrupt management unit141, the wait time period measurement unit 142, the start request waitunit 143, the timing prediction unit 144, and the control processingunit 145. The interrupt management unit 141 invokes the functions of thewait time period measurement unit 142, the timing prediction unit 144,and the control processing unit 145.

The wait time period measurement unit 142 measures a time period fromcompletion of the interrupt preparation process to generation of thestart request 201 as the wait time period. Specifically, upon completionof the interrupt preparation process, the wait time period measurementunit 142 obtains the current time as a start time, and treats the timewhen the start request 201 is generated as an end time. Then, the waittime period measurement unit 142 measures the time period from the starttime to the end time as the wait time period.

The start request wait unit 143 waits for a periodic signal, which isthe start request 201, and notifies the wait time period measurementunit 142 of generation of the start request 201.

The timing prediction unit 144 includes the time calculation unit 441and the time storage unit 442.

The time calculation unit 441 calculates a subtraction time period basedon the wait time period measured by the wait time period measurementunit 142, and calculates a preparation time period that is the sum of atime period obtained by subtracting the subtraction time period from thewait time period and a processing time period of the interruptpreparation process. Then, the time calculation unit 441 stores a timethat is earlier than the time of a next start request 201 only by thepreparation time period, that is, the time obtained by shifting back thepreparation time period from the time of the next start request, as anext interrupt time in the time storage unit 442. The time calculationunit 441 calculates a time period obtained by multiplying the wait timeperiod by a threshold value representing a ratio, as the subtractiontime period. The threshold value is stored in the memory 2.Specifically, the threshold value is predetermined, such as one-half,one-third, or three-fifth.

The time storage unit 442 stores the interrupt time at which theinterrupt preparation process for preparing for the interrupt process isto be started. The time storage unit 442 sets a timing at which theinterrupt handler unit 130 is to generate a next timer interrupt as theinterrupt time.

The control processing unit 145 includes the control information inputunit 451, the control process computation unit 452, and the resultoutput unit 453. The control information input unit 451 obtains controltarget information from the control target device 300. The controlprocess computation unit 452 performs computation based on the controltarget information. The result output unit 453 outputs a result of thecomputation to the control target device 300.

*** Description of Operation ***

FIG. 3 is a flowchart illustrating operation of the interrupt controlapparatus 100 according to this embodiment.

In step S1, the OS is started by the OS execution unit 110.

In step S2, an application program is executed by the applicationprocessing unit 120.

In step S3, the interrupt handler unit 130 generates a timer interruptat the interrupt time set in the time storage unit 442, and executes theinterrupt preparation process.

In step S4, the interrupt processing unit 140 executes an interruptmanagement process.

In step S5, the interrupt handler unit 130 executes an interrupt handlerexit process.

Then, the operation returns to the execution of the application programby the application processing unit 120, that is, step S2.

FIG. 4 is a timing diagram of the interrupt process according to thisembodiment. In FIG. 4, upon completion of the interrupt handler exitprocess of (A1), the application process of (A2) is executed. A state inwhich the interrupt preparation process of (A3) is then executed isindicated.

FIG. 5 is a detailed flowchart of the interrupt management process ofstep S4 according to this embodiment.

In the interrupt management process, each functional component unit tobe executed as the interrupt management process is invoked from theinterrupt management unit 141.

In step S41, the wait time period measurement unit 142 obtains thecurrent time as the start time. In an example in FIG. 4, a start time t1is obtained.

In step S42, the start request wait unit 143 executes a wait process tocheck whether the start request 201 from the periodic signal device 200is present. If the start request 201 is present, the process proceeds tostep S43. If the start request 201 is not present, step S42 is repeateduntil the start request 201 is present.

In step S43, the wait time period measurement unit 142 obtains thecurrent time as the end time. In the example in FIG. 4, an end time t2is obtained. The wait time period measurement unit 142 calculates a waittime period Tt based on a difference between the start time t1 and theend time t2.

In step S44, the timing prediction unit 144 executes a timing predictionprocess to predict an interrupt time tw, which is the timing of a timerinterrupt.

In step S45, the control processing unit 145 executes the controlprocess of (A4), which is the interrupt process.

FIG. 6 is a detailed flowchart of the timing prediction process of stepS44 according to this embodiment.

In step S441, the time calculation unit 441 calculates a subtractiontime period Ts based on the wait time period Tt measured by the waittime period measurement unit 142. Specifically, the time calculationunit 441 calculates a time period obtained by multiplying the wait timeperiod Tt by a threshold value representing a ratio, as the subtractiontime period Ts. For example, the time calculation unit 441 calculates atime period obtained by multiplying the wait time period Tt by one-half,that is, half the time period of the wait time period Tt, as thesubtraction time period Ts. Note that the time calculation unit 441 mayobtain only the start time t1 and the end time t2 from the wait timeperiod measurement unit 142, and the time calculation unit 441 maycalculate the wait time period Tt based on a difference between thestart time t1 and the end time t2.

In step S442, the time calculation unit 441 calculates a preparationtime period Tj that is the sum of a time period obtained by subtractingthe subtraction time period Ts from the wait time period Tt and aprocessing time period Te of the interrupt preparation process. Notethat a processing time period for obtaining the start time t1 may bepre-included in the preparation time period Tj.

In step S443, the time calculation unit 441 sets a time tw that isearlier than a time tn of the next start request by the preparation timeperiod Tj as the next interrupt time. In other words, the timecalculation unit 441 sets the time obtained by shifting back thepreparation time period Tj from the time tn of the next start request asthe next interrupt time tw. The time calculation unit 441 stores theinterrupt time tw as the interrupt timing of the next timer interrupt inthe time storage unit 442.

FIG. 7 is a detailed flowchart of the control process of step S45according to this embodiment.

In step S451, the control information input unit 451 obtains controlinformation from the control target device 300.

In step S452, the control process computation unit 452 executescomputation of the control process, using the control information.

In step S453, the result output unit 453 outputs a result of thecomputation to the control target device 300.

Description of Effects of this Embodiment

FIG. 8 is an example of a timing diagram to be compared with theinterrupt process according to this embodiment. FIG. 8 indicates atiming diagram of a case in which the control process is started bygenerating a timer interrupt concurrently with a start request. In FIG.8, upon completion of the interrupt handler exit process of (B1), theapplication process of (B2) is executed. Then, the interrupt preparationprocess of (B3) is executed and the control process of (B4) is started.Therefore, in the timing diagram of FIG. 8, a delay occurs in the starttiming of the control process, depending on the processing time periodof the interrupt preparation process.

FIG. 9 is another example of a timing diagram to be compared with theinterrupt process according to this embodiment. FIG. 9 indicates amethod in which the timing of a timer interrupt is predicted and thetimer interrupt is generated at a time earlier than a start request. InFIG. 9, (C1) is the interrupt handler exit process and (C2) is theapplication process. In the method of FIG. 9, the processing time periodof the interrupt preparation process is measured in advance. Then, thetimer interrupt is generated at a time that is earlier than a startrequest by a time period that is the sum of the measured time period anda wait time period a. That is, in the method of FIG. 9, the timerinterrupt is generated at the time that is earlier than the startrequest only by the time period that is the sum of the execution timeperiod of the interrupt preparation process of (C3) and the wait timeperiod a. In FIG. 9, when the timer interrupt is generated, theinterrupt preparation process of (C3) is executed, and after waiting forthe wait time period a, the control process of (C4) is executed.However, a period of a certain length needs to be secured as the waittime period a in order to accommodate a change in the processing timeperiod of the interrupt preparation process.

FIG. 4 is a timing diagram based on the interrupt process according tothis embodiment. In the interrupt process according to this embodiment,the preparation time period Tj for setting the interrupt time in thenext period is a time period obtained by subtracting half the value ofthe wait time period Tt from a previous preparation time period Tj′.Therefore, the wait time period Tt will be halved in each period, sothat the preparation time period Tj can also be shortened in eachperiod.

As described above, in this embodiment, the wait time period measurementunit and the timing prediction unit are provided, so that even when theexecution time period of the interrupt preparation process changes,there is no need to re-measure it. Furthermore, in the comparisonexample in FIG. 9, the interrupt time of a timer interrupt needs to beset by adding the wait time period a to the processing time period ofthe interrupt preparation process. However, in this embodiment, theinterrupt time of a timer interrupt can be set such that a wait state isentered immediately before a start request.

In the interrupt control apparatus according to this embodiment, thetiming to start the preparation process can be set such that thepreparation process is completed immediately before a start request witha minimum margin, without being affected by a difference between theexecution time period in an environment in which measurement isperformed in advance and the execution time period in an environment inwhich the control process is executed.

*** Other Configurations ***

<First Variation>

In this embodiment, a start request is input to the interrupt controlapparatus from the periodic signal device external to the interruptcontrol apparatus 100. However, there may be an arrangement toperiodically issue a start request within the interrupt controlapparatus, instead of inputting a start request from the outside of theinterrupt control apparatus.

<Second Variation>

In this embodiment, the interrupt preparation process is described asthe preparation process. Substantially the same effects can be obtainedin other cases such as a case in which a required preparation process isloading data from a memory.

<Third Variation>

In the timing prediction process of this embodiment, processing to halvethe wait time period in each period is performed. However, processingother than halving may be performed, provided that the wait time perioddecreases in each period.

Alternatively, the measured wait time period may be directly subtractedfrom the previous interrupt timing. For example, by setting thethreshold value to 0, the subtraction time period can be set to 0 andthe wait time period can be directly subtracted from the interrupttiming. With this variation, it can be expected that there will be nowait time period in the next period. Alternatively, a plurality ofprevious wait time periods may be stored so that they can be referredto, and the interrupt timing in the next period may be calculated basedon the plurality of pervious wait time periods. Alternatively, anallowable time period for the wait time period may be determined inadvance, and if the wait time period is within the allowable wait timeperiod, the set value of the timer interrupt may be the same value asthat of the previous interrupt timing. This makes it possible to keepthe wait time period within the allowable time period and also to reducethe probability that a start request has already been issued whenmeasurement of the wait time period is started.

<Fourth Variation>

In this embodiment, the units of the interrupt control apparatus 100 arerealized by software. As a variation, the functions of the units of theinterrupt control apparatus 100 may be realized by hardware. In thiscase, the interrupt control apparatus 100 includes an electronic circuitin place of the processor 1.

The electronic circuit is a dedicated electronic circuit that realizesthe functions of the units of the interrupt control apparatus 100.

Specifically, the electronic circuit is a single circuit, a compositecircuit, a programmed processor, a parallel-programmed processor, alogic IC, a GA, an ASIC, or an FPGA. GA is an abbreviation for GateArray. ASIC is an abbreviation for Application Specific IntegratedCircuit. FPGA is an abbreviation for Field-Programmable Gate Array.

The functions of the units of the interrupt control apparatus 100 may berealized by one electronic circuit, or may be distributed among andrealized by a plurality of electronic circuits.

As another variation, some of the functions of the units of theinterrupt control apparatus 100 may be realized by the electroniccircuit, and the rest of the functions may be realized by software.

Each of the processor and the electronic circuit is also referred to asprocessing circuitry. That is, in the interrupt control apparatus 100,the functions of the units of the interrupt control apparatus 100 arerealized by the processing circuitry.

Second Embodiment

In this embodiment, differences from the first embodiment will be mainlydescribed. The components that are substantially the same as those inthe first embodiment are denoted by the same reference signs anddescription thereof may be omitted.

In the first embodiment, the interrupt timing is set such that the waittime period in the next period decreases from the measured wait timeperiod. In this case, there may be a case in which a start request hasalready been issued when measurement of the wait time period is started.The case in which a start request has already been issued whenmeasurement of the wait time period is started is referred to as aviolation. In this embodiment, an interrupt control apparatus 100 a isprovided with an arrangement to prevent a violation from occurring inthe next period.

*** Description of Operation ***

Referring to FIG. 10, a functional configuration of the interruptcontrol apparatus 100 a according to a second embodiment will bedescribed.

The interrupt control apparatus 100 a according to this embodimentincludes a violation processing unit 146 in addition to the functionalcomponents of the interrupt control apparatus 100 of the firstembodiment. The violation processing unit 146 has a function ofdetecting a violation and a function of calculating an interrupt time incase of a violation. The violation processing unit 146 determineswhether a start request has been generated after completion of theinterrupt preparation process and before acquirement of the start time.If a start request has been generated, the violation processing unit 146increases the next preparation time period to be longer than theprevious preparation time period. The violation processing unit 146 setsthe next interrupt time, using the next preparation time period that hasbeen increased.

FIG. 11 is a detailed flowchart of the interrupt management processaccording to this embodiment.

In step S46, the violation processing unit 146 determines whether aviolation has been detected. The violation processing unit 146 detectswhether a violation has occurred by checking whether a start request hasbeen generated immediately after the timer interrupt. If no violation isdetected, the process proceeds to step S41. The process from steps S41to S45 is substantially the same as the process from steps S41 to S45 inFIG. 5.

If a violation is detected, the process proceeds to step S47.

In steps S47 and S46, the violation processing unit 146 increases thepreparation time period Tj used for setting the previous interrupt timetw, and sets the next interrupt time, using the increased preparationtime period. Then, the violation processing unit 146 stores the nextinterrupt time in the time storage unit 442.

Description of Effects of this Embodiment

In the interrupt control apparatus according to this embodiment, whenthe violation processing unit detects a violation, the previouspreparation time period is increased and the timer interrupt is set withthe increased preparation time period. Therefore, recovery from theviolation can be attempted in the next period. In addition, theinterrupt timing can be calculated such that if a violation occurs once,recovery from the violation is achieved without recurrence of theviolation in subsequent periods.

Third Embodiment

In this embodiment, differences from the first embodiment will be mainlydescribed. The components that are substantially the same as those inthe first embodiment are denoted by the same reference signs anddescription thereof may be omitted.

The first embodiment has been described assuming that the processor 1 isa single-core processor. In this embodiment, an interrupt control system500 b and an interrupt control apparatus 100 b will be described, inwhich a multi-core processor 5 is a multi-core processor including acore-0 and a core-1, and the core-0 and the core-1 process the controlprocess in parallel. In the core-0, a periodic interrupt to start thecontrol process is generated periodically, and immediately after that,the start request 201 for the control process is issued from the core-0to the core-1 to start parallel processing.

*** Description of Configurations ***

Referring to FIG. 12, hardware configurations of the interrupt controlsystem 500 b and the interrupt control apparatus 100 b according to thisembodiment will be described.

The interrupt control apparatus 100 b includes the multi-core processor5, a shared memory 8, and the control target interface 4. The multi-coreprocessor 5 is equipped with a core-0 6, which is a device to executethe control process, and a core-1 7 to predict an interrupt timing. Theshared memory 8 is a device for sharing data necessary for the controlprocess between the two cores.

Referring to FIG. 13, a functional configuration of the interruptcontrol apparatus 100 b according to this embodiment will be described.

The interrupt control apparatus 100 b is composed of the core-0 6 andthe core-1 7.

The core-0 includes an OS execution unit 110 x, an applicationprocessing unit 120 x, a periodic interrupt handler unit 130 x, and aperiodic interrupt processing unit 140 x. The periodic interrupt handlerunit 130 x generates a periodic interrupt at a start timing of thecontrol process and invokes a periodic interrupt management unit 141 x.The control process is executed periodically by the periodic interrupt.The periodic interrupt processing unit 140 x includes the periodicinterrupt management unit 141 x, a control processing unit 145 x, and astart request unit 147. The periodic interrupt management unit 141 xinvokes the start request unit 147 and the control processing unit 145x. The start request unit 147 notifies the core-1 of a start request forthe control process. The control processing unit 145 x includes thecontrol information input unit 451, a control process computation unit452 x, and the result output unit 453. The control process computationunit 452 x executes the control process assigned to the core-0, andexecutes the control process while sharing data with a control processcomputation unit 452 y of the core-1.

The core-1 includes an OS execution unit 110 y, an applicationprocessing unit 120 y, a timer interrupt handler unit 130 y, and a timerinterrupt processing unit 140 y. The control process computation unit452 y of a control processing unit 145 y in the timer interruptprocessing unit 140 y executes the control process assigned to thecore-1, and executes the control process while sharing data with thecontrol process computation unit 452 x of the core-0.

*** Description of Operation ***

FIG. 14 is a flowchart illustrating operation of the core-0 of theinterrupt control apparatus 100 b according to this embodiment.

Steps S10 and S11 are substantially the same as steps S1 and S2 in FIG.3.

In step S12, the periodic interrupt handler unit 130 x generates aperiodic interrupt, and the periodic interrupt handler unit 130 xexecutes a periodic interrupt handler entrance process.

Then, in step S13, the periodic interrupt management unit 141 x executesa periodic interrupt management process.

Then, in step S14, the periodic interrupt handler unit 130 x executes aperiodic interrupt handler output process.

FIG. 15 is a detailed flowchart of the periodic interrupt managementprocess according to this embodiment.

In the periodic interrupt management process, each functional componentunit to be executed as the periodic interrupt management process isinvoked from the periodic interrupt management unit 141 x.

In step S130, the start request unit 147 issues a start request to thecore-1.

In step S131, the control processing unit 145 x executes the controlprocess.

FIG. 16 is a flowchart illustrating operation of the core-1 of theinterrupt control apparatus 100 b according to this embodiment.

Steps S20 to S24 are substantially the same as steps S1 to S5 in FIG. 3.In FIG. 16, the interrupt preparation process is described as the timerinterrupt handler entrance process.

Description of Effects of this Embodiment

The interrupt control apparatus 100 b according to this embodimentincludes a multi-core processor equipped with two processors to processthe interrupt process in parallel. The core-0, which is one processor ofthe two processors, includes the start request unit to regularly outputa start request. The core-1, which is the other processor of the twoprocessors, includes the time storage unit, the interrupt handler unitfor the timer interrupt, the wait time period measurement unit, and thetime calculation unit.

In this embodiment, substantially the same effects as those of the firstembodiment can also be obtained in the interrupt control apparatus 100 bconstituted with the multi-core processor. That is, the interrupt timeof a timer interrupt can be set such that a wait state is enteredimmediately before a periodic start request.

*** Other Configurations ***

The second and third embodiments can also be modified as described inthe variations of the first embodiment.

In the first to third embodiments above, each unit of the interruptcontrol apparatus is described as an independent functional block.However, the configuration of the interrupt control apparatus may bedifferent from the configurations in the above embodiments. Functionalblocks of the interrupt control apparatus may be arranged in anyconfiguration, provided that the functions described in the aboveembodiments can be realized. The interrupt control apparatus may be asystem composed of a plurality of apparatuses, instead of a singleapparatus.

Portions of the first to third embodiments may be implemented incombination. Alternatively, one portion of these embodiments may beimplemented. Furthermore, these embodiments may be implemented as awhole or partially in any combination. That is, in the first to thirdembodiments, the embodiments can be freely combined, or any component ofeach embodiment can be modified, or any component can be omitted in eachembodiment.

The embodiments described above are essentially preferable examples, andare not intended to limit the scope of the present invention, the scopeof applications of the present invention, and the scope of intended usesof the present invention. The embodiments described above can bemodified in various ways as needed.

REFERENCE SIGNS LIST

1: processor; 2: memory; 3: periodic signal interface; 4: control targetinterface; 5: multi-core processor; 6: core-0; 7: core-1; 8: sharedmemory; 100, 100 a, 100 b: interrupt control apparatus; 110, 110 x, 110y: OS execution unit; 120, 120 x, 120 y: application processing unit;130: interrupt handler unit; 130 x: periodic interrupt handler unit; 130y: timer interrupt handler unit; 140: interrupt processing unit; 140 x:periodic interrupt processing unit; 140 y: timer interrupt processingunit; 141: interrupt management unit; 141 x: periodic interruptmanagement unit; 141 y: timer interrupt management unit; 142: wait timeperiod measurement unit; 143: start request wait unit; 144: timingprediction unit; 441: time calculation unit; 442: time storage unit;145, 145 x, 145 y: control processing unit; 451: control informationinput unit; 452, 452 x, 452 y: control process computation unit; 453:result output unit; 146: violation processing unit; 147: start requestunit; 200: periodic signal device; 201: start request; 300: controltarget device; 500, 500 b: interrupt control system; t1: start time; t2:end time

1. An interrupt control apparatus to start an interrupt process inresponse to a start request generated regularly, the interrupt controlapparatus comprising: a memory to store an interrupt time at which aninterrupt preparation process for preparing for the interrupt process isto be started; and processing circuitry to: generate a timer interruptat the interrupt time, and execute the interrupt preparation process;measure a time period from completion of the interrupt preparationprocess to generation of the start request as a wait time period; andcalculate a subtraction time period based on the measured wait timeperiod, calculate a preparation time period that is a sum of a timeperiod obtained by subtracting the subtraction time period from the waittime period and a processing time period of the interrupt preparationprocess, and store a time obtained by shifting back the preparation timeperiod from a time of a next start request, as a next interrupt time, inthe memory.
 2. The interrupt control apparatus according to claim 1,wherein the processing circuitry calculates, as the subtraction timeperiod, a time period obtained by multiplying the wait time period by athreshold value representing a ratio.
 3. The interrupt control apparatusaccording to claim 2, wherein the threshold value is one-half.
 4. Theinterrupt control apparatus according to claim 1, wherein uponcompletion of the interrupt preparation process, the processingcircuitry obtains a current time as a start time, treats a time at whichthe start request is generated as an end time, and measures a timeperiod from the end time to the start time as the wait time period. 5.The interrupt control apparatus according to claim 2, wherein uponcompletion of the interrupt preparation process, the processingcircuitry obtains a current time as a start time, treats a time at whichthe start request is generated as an end time, and measures a timeperiod from the end time to the start time as the wait time period. 6.The interrupt control apparatus according to claim 3, wherein uponcompletion of the interrupt preparation process, the processingcircuitry obtains a current time as a start time, treats a time at whichthe start request is generated as an end time, and measures a timeperiod from the end time to the start time as the wait time period. 7.The interrupt control apparatus according to claim 4, wherein theprocessing circuitry determines whether the start request has beengenerated after completion of the interrupt preparation process andbefore acquirement of the start time, and when the start request hasbeen generated, increases a next preparation time period to be longerthan the preparation time period.
 8. The interrupt control apparatusaccording to claim 5, wherein the processing circuitry determineswhether the start request has been generated after completion of theinterrupt preparation process and before acquirement of the start time,and when the start request has been generated, increases a nextpreparation time period to be longer than the preparation time period.9. The interrupt control apparatus according to claim 6, wherein theprocessing circuitry determines whether the start request has beengenerated after completion of the interrupt preparation process andbefore acquirement of the start time, and when the start request hasbeen generated, increases a next preparation time period to be longerthan the preparation time period.
 10. The interrupt control apparatusaccording to claim 1, further comprising a multi-core processorincluding two processors to process the interrupt process in parallel,wherein one processor of the two processors includes processingcircuitry to regularly output the start request, and the other processorof the two processors includes: said memory to store an interrupt timeat which an interrupt preparation process for preparing for theinterrupt process is to be started; and said processing circuitry to:generate a timer interrupt at the interrupt time, and execute theinterrupt preparation process; measure a time period from completion ofthe interrupt preparation process to generation of the start request asa wait time period; and calculate a subtraction time period based on themeasured wait time period, calculate a preparation time period that is asum of a time period obtained by subtracting the subtraction time periodfrom the wait time period and a processing time period of the interruptpreparation process, and store a time obtained by shifting back thepreparation time period from a time of a next start request, as a nextinterrupt time, in the memory.
 11. The interrupt control apparatusaccording to claim 2, further comprising a multi-core processorincluding two processors to process the interrupt process in parallel,wherein one processor of the two processors includes processingcircuitry to regularly output the start request, and the other processorof the two processors includes: said memory to store an interrupt timeat which an interrupt preparation process for preparing for theinterrupt process is to be started; and said processing circuitry to:generate a timer interrupt at the interrupt time, and execute theinterrupt preparation process; measure a time period from completion ofthe interrupt preparation process to generation of the start request asa wait time period; and calculate a subtraction time period based on themeasured wait time period, calculate a preparation time period that is asum of a time period obtained by subtracting the subtraction time periodfrom the wait time period and a processing time period of the interruptpreparation process, and store a time obtained by shifting back thepreparation time period from a time of a next start request, as a nextinterrupt time, in the memory.
 12. The interrupt control apparatusaccording to claim 3, further comprising a multi-core processorincluding two processors to process the interrupt process in parallel,wherein one processor of the two processors includes processingcircuitry to regularly output the start request, and the other processorof the two processors includes: said memory to store an interrupt timeat which an interrupt preparation process for preparing for theinterrupt process is to be started; and said processing circuitry to:generate a timer interrupt at the interrupt time, and execute theinterrupt preparation process; measure a time period from completion ofthe interrupt preparation process to generation of the start request asa wait time period; and calculate a subtraction time period based on themeasured wait time period, calculate a preparation time period that is asum of a time period obtained by subtracting the subtraction time periodfrom the wait time period and a processing time period of the interruptpreparation process, and store a time obtained by shifting back thepreparation time period from a time of a next start request, as a nextinterrupt time, in the memory.
 13. The interrupt control apparatusaccording to claim 4, further comprising a multi-core processorincluding two processors to process the interrupt process in parallel,wherein one processor of the two processors includes processingcircuitry to regularly output the start request, and the other processorof the two processors includes: said memory to store an interrupt timeat which an interrupt preparation process for preparing for theinterrupt process is to be started; and said processing circuitry to:generate a timer interrupt at the interrupt time, and execute theinterrupt preparation process; measure a time period from completion ofthe interrupt preparation process to generation of the start request asa wait time period; and calculate a subtraction time period based on themeasured wait time period, calculate a preparation time period that is asum of a time period obtained by subtracting the subtraction time periodfrom the wait time period and a processing time period of the interruptpreparation process, and store a time obtained by shifting back thepreparation time period from a time of a next start request, as a nextinterrupt time, in the memory.
 14. The interrupt control apparatusaccording to claim 5, further comprising a multi-core processorincluding two processors to process the interrupt process in parallel,wherein one processor of the two processors includes processingcircuitry to regularly output the start request, and the other processorof the two processors includes: said memory to store an interrupt timeat which an interrupt preparation process for preparing for theinterrupt process is to be started; and said processing circuitry to:generate a timer interrupt at the interrupt time, and execute theinterrupt preparation process; measure a time period from completion ofthe interrupt preparation process to generation of the start request asa wait time period; and calculate a subtraction time period based on themeasured wait time period, calculate a preparation time period that is asum of a time period obtained by subtracting the subtraction time periodfrom the wait time period and a processing time period of the interruptpreparation process, and store a time obtained by shifting back thepreparation time period from a time of a next start request, as a nextinterrupt time, in the memory.
 15. The interrupt control apparatusaccording to claim 6, further comprising a multi-core processorincluding two processors to process the interrupt process in parallel,wherein one processor of the two processors includes processingcircuitry to regularly output the start request, and the other processorof the two processors includes: said memory to store an interrupt timeat which an interrupt preparation process for preparing for theinterrupt process is to be started; and said processing circuitry to:generate a timer interrupt at the interrupt time, and execute theinterrupt preparation process; measure a time period from completion ofthe interrupt preparation process to generation of the start request asa wait time period; and calculate a subtraction time period based on themeasured wait time period, calculate a preparation time period that is asum of a time period obtained by subtracting the subtraction time periodfrom the wait time period and a processing time period of the interruptpreparation process, and store a time obtained by shifting back thepreparation time period from a time of a next start request, as a nextinterrupt time, in the memory.
 16. The interrupt control apparatusaccording to claim 7, further comprising a multi-core processorincluding two processors to process the interrupt process in parallel,wherein one processor of the two processors includes processingcircuitry to regularly output the start request, and the other processorof the two processors includes: said memory to store an interrupt timeat which an interrupt preparation process for preparing for theinterrupt process is to be started; and said processing circuitry to:generate a timer interrupt at the interrupt time, and execute theinterrupt preparation process; measure a time period from completion ofthe interrupt preparation process to generation of the start request asa wait time period; and calculate a subtraction time period based on themeasured wait time period, calculate a preparation time period that is asum of a time period obtained by subtracting the subtraction time periodfrom the wait time period and a processing time period of the interruptpreparation process, and store a time obtained by shifting back thepreparation time period from a time of a next start request, as a nextinterrupt time, in the memory.
 17. The interrupt control apparatusaccording to claim 8, further comprising a multi-core processorincluding two processors to process the interrupt process in parallel,wherein one processor of the two processors includes processingcircuitry to regularly output the start request, and the other processorof the two processors includes: said memory to store an interrupt timeat which an interrupt preparation process for preparing for theinterrupt process is to be started; and said processing circuitry to:generate a timer interrupt at the interrupt time, and execute theinterrupt preparation process; measure a time period from completion ofthe interrupt preparation process to generation of the start request asa wait time period; and calculate a subtraction time period based on themeasured wait time period, calculate a preparation time period that is asum of a time period obtained by subtracting the subtraction time periodfrom the wait time period and a processing time period of the interruptpreparation process, and store a time obtained by shifting back thepreparation time period from a time of a next start request, as a nextinterrupt time, in the memory.
 18. The interrupt control apparatusaccording to claim 9, further comprising a multi-core processorincluding two processors to process the interrupt process in parallel,wherein one processor of the two processors includes processingcircuitry to regularly output the start request, and the other processorof the two processors includes: said memory to store an interrupt timeat which an interrupt preparation process for preparing for theinterrupt process is to be started; and said processing circuitry to:generate a timer interrupt at the interrupt time, and execute theinterrupt preparation process; measure a time period from completion ofthe interrupt preparation process to generation of the start request asa wait time period; and calculate a subtraction time period based on themeasured wait time period, calculate a preparation time period that is asum of a time period obtained by subtracting the subtraction time periodfrom the wait time period and a processing time period of the interruptpreparation process, and store a time obtained by shifting back thepreparation time period from a time of a next start request, as a nextinterrupt time, in the memory.
 19. An interrupt control method of aninterrupt control apparatus to start an interrupt process in response toa start request generated regularly, the interrupt control apparatusincluding a memory to store an interrupt time at which an interruptpreparation process for preparing for the interrupt process is to bestarted, the interrupt control method comprising: generating a timerinterrupt at the interrupt time, and executing the interrupt preparationprocess; measuring a time period from completion of the interruptpreparation process to generation of the start request as a wait timeperiod; and calculating a subtraction time period based on the measuredwait time period, calculating a preparation time period that is a sum ofa time period obtained by subtracting the subtraction time period fromthe wait time period and a processing time period of the interruptpreparation process, and storing a time obtained by shifting back thepreparation time period from a time of a next start request, as a nextinterrupt time, in the memory.
 20. A non-transitory computer readablemedium storing an interrupt control program for an interrupt controlapparatus to start an interrupt process in response to a start requestgenerated regularly, the interrupt control apparatus including a memoryto store an interrupt time at which an interrupt preparation process forpreparing for the interrupt process is to be started, the interruptcontrol program causing a computer to execute: an interrupt handlerprocess of generating a timer interrupt at the interrupt time, andexecuting the interrupt preparation process; a wait time periodmeasurement process of measuring a time period from completion of theinterrupt preparation process to generation of the start request as await time period; and a time calculation process of calculating asubtraction time period based on the wait time period measured by thewait time period measurement process, calculating a preparation timeperiod that is a sum of a time period obtained by subtracting thesubtraction time period from the wait time period and a processing timeperiod of the interrupt preparation process, and storing a time obtainedby shifting back the preparation time period from a time of a next startrequest, as a next interrupt time, in the memory.